<template xmlns="">
  <div>
    <!--头部-->
    <div style="height: 60px; line-height: 60px; background-color: #4e74ab; margin-bottom: 2px; display:flex ">
      <div style="width: 300px">
        <img src="@/assets/school.png" alt="" style="width: 35px; height: 35px; position: relative; top: 6px; left: 15px">
        <span style="margin-left: 25px; font-size: 20px; color: white; font-weight:bold">欢迎你！管理员</span>
      </div>
      <div style="flex: 1; text-align: right; padding-right: 20px">
        <el-dropdown size="medium" trigger="click">
          <span class="el-dropdown-link" style="cursor: pointer">
            用户名<i class="el-icon-arrow-down el-icon--right"></i>
          </span>

          <el-dropdown-menu slot="dropdown" style="margin-top: -5px">

            <el-dropdown-item >
              <div @click="logout">退出</div>
            </el-dropdown-item>
            <el-dropdown-item >
              <div style="width: 50px; text-align: center" >hello</div>
            </el-dropdown-item>

          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>

    <!--    侧边栏和主题-->
    <div style="display: flex;">

      <!--      侧边栏导航-->
      <div style="width: 230px; min-height: calc(100vh - 62px); overflow: hidden; margin-right: 2px; background-color:#545c64">
        <el-menu
            :default-active="$route.path"
            router class="el-menu-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
        >
          <el-menu-item index="/">
            <i class="el-icon-s-home"></i>
            <span>首页</span>
          </el-menu-item>

          <el-submenu index="student">
            <template slot="title">
              <i class="el-icon-s-promotion"></i>
              <span>用户管理</span>
            </template>
            <el-menu-item index="/studentList">学生管理</el-menu-item>
          </el-submenu>

        </el-menu>

      </div>

      <!--      主体-->
      <div style="flex: 1; width:0;  background-color: white; padding:10px">
        <router-view/>
      </div>

    </div>
  </div>
</template>

<script>


export default {
  name: "Layout",

  data(){
    return{

    }
  },
  methods:{
    logout(){
      this.$router.push('/login')
    }
  }
}
</script>

<style>
.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
}
.el-icon-arrow-down {
  font-size: 12px;
}
</style>